package com.folderit.apps.rooms.sync;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class RoomsSyncService extends Service {
    private static final Object sSyncAdapterLock = new Object();
    private static RoomsSyncAdapter sRoomsSyncAdapter = null;

    @Override
    public void onCreate() {
        Log.d("RoomsSyncService", "onCreate - RoomsSyncService");
        synchronized (sSyncAdapterLock) {
            if (sRoomsSyncAdapter == null) {
                sRoomsSyncAdapter = new RoomsSyncAdapter(getApplicationContext(), true);
            }
        }
    }

    @Override
    public IBinder onBind(Intent intent) {
        return sRoomsSyncAdapter.getSyncAdapterBinder();
    }
}